
#include <stdio.h>

//定义结构
struct date {
    int year;
    int month;
    int day;
};

void prn(struct date p)  //函数输出p的各成员项
{
    printf("%d-%d-%d\n", p.year, p.month, p.day);
}

struct date GetData() //函数为形参p赋值
{
    struct date p;
    p.year = 2000;
    p.month = 5;
    p.day = 22;
    return p;
}

int main(void) {
    struct date d = GetData();
    prn(d);
    return 0;
}
